package com.lyt.springboot.service;

import com.lyt.springboot.dao.UserDataMapper;
import com.lyt.springboot.domain.UserData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TestMybatisService {
    @Autowired
    private UserDataMapper userDataMapper;

    public UserData testMybatis(Integer id) {
        UserData userData = userDataMapper.selectByPrimaryKey(id);
        return userData;
    }

    public List<UserData> test() {
        List<UserData> userData = userDataMapper.selectAll();
        return userData;
    }

    public UserData test1(Integer id) {
        UserData userData = userDataMapper.selectById(id);
        return userData;
    }
}
